package com.ruoyi.pic.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.pic.service.LideshowService;
import com.ruoyi.pic.utile.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 陌寒    Lenovo
 * @date 2025/3/6上午9:13
 * @description 类描述
 */
@RestController
@RequestMapping("/lideshow")
public class LideshowController {
    @Autowired
    private LideshowService lideshowService;

    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    @PostMapping("/updatefile")
    public Result fileUploadService(@RequestParam("file") MultipartFile file) throws Exception {
        String fileUrl=lideshowService.updatefile(file);
        return Result.ok(fileUrl) ;
    }


}
